﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ModePanel : BasePanel
{
	public bool SelectOnline { get; set; }      // 是否选择线上模式
	CanvasGroup canvasGroup;
	private void Awake() {
		canvasGroup = GetComponent<CanvasGroup>();
		uipanelType = UIPanelType.ModePanel;
	}
	public override void OnEnter() {
		canvasGroup.blocksRaycasts = true;
		canvasGroup.alpha = 1;
		transform.SetAsLastSibling();
		GetComponent<RectTransform>().localScale = Vector3.one;
	}

	public override void OnExit() {
		canvasGroup.blocksRaycasts = false;
		canvasGroup.alpha = 0;
		GetComponent<RectTransform>().localScale = Vector3.zero;
	}

	public override void OnPause() {
		canvasGroup.blocksRaycasts = false;
	}

	public override void OnResume() {
		canvasGroup.blocksRaycasts = true;
	}


	/// <summary>
	/// 选择单机模式
	/// </summary>
	public void OnClickSingleMode() {
		SelectOnline = false;
		uiMng.PushStack(UIPanelType.MenuPanel);
	}

	/// <summary>
	/// 选择线上模式
	/// </summary>
	public void OnClickOnlineMode() {
		SelectOnline = true;
		uiMng.PushStack(UIPanelType.MenuPanel);
	}


}
